/**
 * @Author Stringzhua
 * @Date 2024/1/15 14:17
 * description:算术运算符
 */
public class ArithmeticOperatorExercise01 {
    public static void main(String[] args) {
        //面试题1
        int a = 1;//i-->1
        a = a++;//(1)temp=i;(2)i=i+1;(3)i=temp
        System.out.println("a = " + a);//1
        //面试题2
        int k = 1;//k-->1
        k = ++k;//(1)i=i+1(2)temp=i(3)i=temp
        System.out.println("k = " + k);//

        int i1 = 10;
        int i2 = 20;
        int i = i1++;
        System.out.println("i = " + i);//10
        System.out.println("i2 = " + i2);//20
        i = --i2;
        System.out.println("i = " + i);//19
        System.out.println("i2 = " + i2);//19
    }
}